Add a very bad fallback check
authorMatthias Clasen <mclasen@redhat.com>
Tue, 29 Nov 2011 04:40:18 +0000 (23:40 -0500)
committerRyan Lortie <desrt@desrt.ca>
Mon, 19 Dec 2011 17:51:07 +0000 (12:51 -0500)
...maybe committing this inspires some better solution.

gtk/gtkapplication.c

index 15469958fcb506b74ffcd907a0d4aa05e99f77e4..7c540323f5769a00c9303d9541b278b13c7c4b38 100644 (file)
@@ -741,7 +741,27 @@ gtk_application_get_menu (GtkApplication *application)
   if (!model)
     return NULL;
 
-  /* FIXME: find out if external menu is available. If yes, return NULL */
+  /* FIXME: find out if external menu is available. If yes, return NULL.
+   * For now, we just check if the wm is mutter (ie gnome-shell)
+   */
+#ifdef GDK_WINDOWING_X11
+  if (application->priv->windows)
+    {
+      GtkWidget *window;
+      GdkScreen *screen;
+
+      window = application->priv->windows->data;
+      screen = gtk_widget_get_screen (window);
+      if (GDK_IS_X11_SCREEN (screen))
+        {
+          const gchar *wm;
+
+          wm = gdk_x11_screen_get_window_manager_name (GDK_X11_SCREEN (screen));
+          if (g_strcmp0 (wm, "Mutter") == 0)
+            return NULL;
+        }
+    }
+#endif
 
   menu = gtk_menu_new ();